package router

import (
	"bluebell/controller"
	"bluebell/logger"
	"net/http"

	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
)

func SetUp() (*gin.Engine) {
	if err := controller.InitTrans("zh");err != nil{
		zap.L().Info("validator init",zap.Error(err))
	}
	r := gin.New()
	r.POST("/signup",controller.SignUpHandler)
	r.POST("/login",controller.UserLogin)
	r.GET("/pong",func(c *gin.Context) {
		c.String(http.StatusOK, "pong")
	})
	r.Use(logger.GinLogger(), logger.GinRecovery(true))
	
	return r
}